package com.video.tiktokdownloader.nowatermark

import com.zhouyou.http.callback.CallBack
import com.zhouyou.http.exception.ApiException

/**
 * @author Afra55
 * @date 2020/6/24
 * A smile is the best business card.
 * 没有成绩，连呼吸都是错的。
 */
typealias SuccessCallBack<R> = (R?) -> Unit
typealias ErrorCallBack<R> = (R?) -> Unit
object StringCallBack{

    fun getCallBack(baseActivity: BaseActivity, successCallBack: SuccessCallBack<String?>, errorCallBack: ErrorCallBack<ApiException?>):CallBack<String> {
       return object : CallBack<String>() {
            override fun onSuccess(t: String?) {
                successCallBack.invoke(t)
            }

            override fun onError(e: ApiException?) {
                errorCallBack.invoke(e)
            }

            override fun onStart() {
//                baseActivity.showMarker()
            }

            override fun onCompleted() {
//                baseActivity.dismissMarker()
            }

        }
    }
}